package cn.yeamin.spring.boot.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @packageName: 包名: cn.yeamin.spring.boot.controller
 * @classDesc: 类功能描述:(全局捕获异常测试)
 * @author: Administrator
 * @createTime: 2017/7/18 19:31
 * @version: v1.0
 * @copyright:奕明(上海)影视传媒有限公司
 */
@RestController
public class ExceptionController {

    @GetMapping("/ex1")
    public String error1() throws Exception {
        throw new Exception("我异常了.你看着办吧!!!=========页面");
       //return "success,no error";
    }

    @RequestMapping("/ex2")
    public String error2() throws RuntimeException {
        throw new RuntimeException("我异常了.你看着办吧!!!=====JSON");
    }
}
